﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="goods.aspx.cs" Inherits="WebSite.admin.product.goods" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>福利点点通 </title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
    <script src="../js/common.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">


       <ext:PageManager ID="PageManager1" runat="server" />
      <ext:SimpleForm ID="extForm1" runat="server" BodyPadding="5px"   
            EnableBackgroundColor="false" Title="商品列表"  ShowHeader="true" >
              <Items>

            <ext:Panel ID="Panel2" ShowHeader="false"  CssClass="x-form-item" ShowBorder="false" Layout="Column" runat="server">

             <Items>
            

           <ext:DropDownList ID="ddlGoodsType"  runat="server" Width="140px"  Text="商品类别" ShowLabel="true" Label="卡状态"></ext:DropDownList>



          <ext:DropDownList ID="ddlGoodsBrand"  runat="server"  Width="120px"  Text="商品品牌" ShowLabel="true" Label="商品品牌"></ext:DropDownList>

            
          <ext:DropDownList ID="ddlTerms"  runat="server"  Text="气节类别" Width="140px"  ShowLabel="true" Label="气节类别"></ext:DropDownList>

            <ext:DropDownList ID="ddlCompanyList"  runat="server"  Text="选择供应商" Width="260px" ShowLabel="true" Label="选择供应商"></ext:DropDownList>

            <ext:Label ID="lblKeywords"  Width="60px"    runat="server" Text="&nbsp;&nbsp;关键字："></ext:Label>
            <ext:TextBox runat="server" ID="txtKeywords"   MaxLength="100" Label="关键字" ></ext:TextBox>
                   <ext:Button ID="btnSearch" Text="搜索"  CssClass="mleft mright" runat="server" 
                     OnClick="btnSearch_Click"></ext:Button>
                  </Items>
         </ext:Panel>

     </Items>
     
   </ext:SimpleForm>

   <ext:Panel ID="Panel8" ShowBorder="True" ShowHeader="false" BoxFlex="1"  CssClass="x-form-item"  Layout="Fit"
                runat="server">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar2" runat="server">
                        <Items>
                   <ext:Button ID="btnBrachDeleted" runat="server" Text="批量删除"  OnClick="btnBrachDeleted_Click1"
                    ConfirmTarget="self" ConfirmText="确定要删除选中的商品吗？" >
                 </ext:Button>
                  <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                            </ext:ToolbarSeparator>
                  <ext:Button ID="btnSale" runat="server" Text="批量上架"  OnClick="btnSale_Click"
                    ConfirmTarget="self" ConfirmText="确定要上架选中的商品吗？" >
                 </ext:Button>
                  <ext:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
                            </ext:ToolbarSeparator>
                 <ext:Button ID="btnNoSale" runat="server" Text="批量下架"  OnClick="btnNoSale_Click"
                    ConfirmTarget="self" ConfirmText="确定要下架选中的商品吗？" >
                 </ext:Button>
               
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
                <Items>
    </Items>
    </ext:Panel>
         <ext:Grid ID="Grid1" Title="查询结果" PageSize="50" ShowBorder="false"  
           CssClass="x-form-item"  Height="418px"  AllowPaging="true" 
           SortColumn="goodsName" SortDirection="ASC"     
                        OnPageIndexChange="Grid1_PageIndexChange" ShowHeader="False" 
           runat="server" EnableCheckBoxSelect="True"   AllowSorting="true"    IsDatabasePaging="true" 
                        DataKeyNames="goodsId" OnSort="Grid1_Sort" 
           EnableRowNumber="True" >

        <Columns>
        
                
          <ext:TemplateField Width="200px"  ColumnID="goodsName" SortField="goodsName" HeaderText="商品名称">
                <ItemTemplate>
                      <a href="#" onclick="openNewTab('AddNewProduct','product/goodsAdd.aspx?gid=<%# Eval("goodsId") %>','商品编辑','')"; title="编辑"><%# Eval("goodsName")%></a>                    
                </ItemTemplate>
            </ext:TemplateField>
            <ext:BoundField Width="100px" ColumnID="goodsCode" SortField="goodsCode" DataField="goodsCode" DataFormatString="{0}"
                HeaderText="货 号" />
           <ext:BoundField Width="100px" ColumnID="changePoints" SortField="changePoints" DataField="changePoints" DataFormatString="{0}"
                HeaderText="兑换福点数" />
              <ext:TemplateField Width="100px" SortField="changePoints" HeaderText="兑换价">
                <ItemTemplate>
                       <%#  Eval("changePoints").ToString() == "" ? "" : (int.Parse(Eval("changePoints").ToString()) * 0.5).ToString()%>
                </ItemTemplate>
            </ext:TemplateField>
           <ext:BoundField Width="100px" ColumnID="rushPoints" SortField=""  DataField="rushPoints" DataFormatString="{0}"
                HeaderText="抢购福点数" />
          <ext:TemplateField Width="100px" SortField="cardcode" HeaderText="抢购价">
                <ItemTemplate>
                    <%#  Eval("rushPoints").ToString() == "" ? "" : (int.Parse(Eval("rushPoints").ToString()) * 0.5).ToString() %>
                </ItemTemplate>
            </ext:TemplateField>
           <ext:CheckBoxField Width="60px" RenderAsStaticField="true" SortField="isSale" DataField="isSale" HeaderText="上架" />
           <ext:CheckBoxField Width="80px" RenderAsStaticField="true" SortField="isRush" DataField="isRush" HeaderText="限时抢购" />
            <ext:CheckBoxField Width="80px" RenderAsStaticField="true" SortField="isRecom" DataField="isRecom" HeaderText="是否推荐" />
           <ext:CheckBoxField Width="80px" RenderAsStaticField="true" SortField="allowAllCard" DataField="allowAllCard" HeaderText="通兑商品" />
           <ext:BoundField Width="100px" ColumnID="brandId" SortField=""  DataField="brandName" DataFormatString="{0}"  HeaderText="品牌" />
            <ext:BoundField Width="100px" ColumnID="termsId" SortField=""  DataField="termsName" DataFormatString="{0}" HeaderText="气节" />
             <ext:BoundField Width="100px" ColumnID="goodsCount" SortField="goodsCount" DataField="goodsCount" DataFormatString="{0}"
                HeaderText="显示库存数" />
           <ext:BoundField Width="100px" ColumnID="realyCount" SortField="realyCount" DataField="realyCount" DataFormatString="{0}"
                HeaderText="实际库存数" />
          <ext:BoundField Width="100px" ColumnID="freezeCount" SortField="freezeCount" DataField="freezeCount" DataFormatString="{0}"
                HeaderText="冻结库存数" />
         <ext:BoundField Width="100px" ColumnID="ableCount" SortField="ableCount" DataField="ableCount" DataFormatString="{0}"
                HeaderText="可用库存数" />
          
          <ext:TemplateField Width="180px" SortField="cardcode" HeaderText="操作">
                <ItemTemplate>
                  
                     <a href="goodsAdd.aspx?gid=<%# Eval("goodsId") %>" title="显示" target="_blank">[显示]</a>
                      <a href="#" onclick="openNewTab('AddNewProduct','product/goodsAdd.aspx?gid=<%# Eval("goodsId") %>','商品编辑','')"; title="编辑">[编辑]</a>
                     <a href="goods.aspx?action=del&amp;gid=<%# Eval("goodsId") %>"  onclick="return confirm('您确定要删除此商品吗？');" title="回收站">[删除]</a>
                    
                </ItemTemplate>
            </ext:TemplateField>
            

        </Columns>
    </ext:Grid>

    </form>
</body>
</html>
